<%@ page language="java" import="java.util.*,com.hs.auth.model.*,com.hs.dnms.model.*" pageEncoding="utf-8"%>
 <% 
   String disid = (String)request.getAttribute("disid")==null?"":(String)request.getAttribute("disid");
   String id = (String)request.getAttribute("id")==null?"":(String)request.getAttribute("id");
   
  %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%@ include file="../../include.jsp"%>  
<script language="javascript" type="text/javascript" src="<%=basePath%>common/uploadify/jquery-1.4.2.min.js"></script>
<script language="javascript" type="text/javascript" src="<%=basePath%>common/javascripts/My97DatePicker/WdatePicker.js"></script>
<script language="javascript" type="text/javascript" src="<%=basePath%>common/uploadify/jquery.uploadify.v2.1.4.js"></script>
<script type="text/javascript" src="<%=basePath%>common/uploadify/swfobject.js"></script>
<LINK rel=stylesheet type=text/css href="<%=basePath%>common/uploadify/uploadify.css"/>  
<script src='<%=basePath%>dwr/interface/dataProhelper.js'></script>  

<script language="javascript" type="text/javascript">
function dataPro(id){
	window.location.href="";

}
  
/**疾病信息保存*/
function saveDisinfo(id){
 	var disname = document.getElementById("disname").value;
	var disnamen = document.getElementById("disnamen").value;
	if(isNull(disname)){
		alert("请输入中医疾病名称！");
		return;
	}
	var istangyao = getRadioValue("istangyao"); 
	var iszhongchengyao = getRadioValue("iszhongchengyao");
	var isxiyi = getRadioValue("isxiyi");
	var iszhenjiu = getRadioValue("iszhenjiu");
	var istuina = getRadioValue("istuina");
	var isshoushu = getRadioValue("isshoushu"); 
	var curemethod = document.getElementById("curemethod").value; 
    dataProhelper.addDis(id,disname,disnamen,'0',istangyao,iszhongchengyao,isxiyi,istuina,iszhenjiu,isshoushu,curemethod,callback4addDis);
}
var disid = 0;
function callback4addDis(message){ 
	var cellFunctions = [   
	      function(item) {   
           	return "<input type='radio' name='disid' value='"+item.id+"'/>";
          }, 
          function(item) {   
           	return "<a href=javaScript:viewDis('"+item.id+"')>"+item.disname+"</a>";
          }, 
          function(item) {  
           	return "<input type=hidden value='"+item.id+"' name='disid_"+item.id + "' id='disid_"+item.id+"/>"+item.disnamen;
          }, 
          function(item) {  
           	return item.content;
          },
          function(item) {  
           	return "<input type='button' onclick=deleteDis('"+item.id+"'); value=' 删 除 '/>";
          }
      ];    
     var index = message.indexOf("$");  
     disid = message.substring(0,index); 
     var rowdata = message.substring(index+1); 
     var data = eval('('+rowdata+')');   
      DWRUtil.addRows("dislist", data, cellFunctions,{
          rowCreator:function(options) { //自定义 tr 的创建行为 
          var trobj = document.createElement("tr");   
          trobj.setAttribute("id","dis_"+disid);  
          return trobj; 
     },cellCreator:function(options) {
	var cell = document.createElement("td"); 
	//if(options.cellNum==0) {//表示第一列，以此类推   
	//  	cell.width = "80%";
	//	}else{
	//	    cell.width = "10%";
	//    cell.align="center";
	     
	//}
	return cell;
}, escapeHtml:false
     });
    alert('疾病信息保存成功！');   
}
 
 function callback4DisDelete(data){    
    var tbody  = document.getElementById("dislist");// tbody 的id 
    var rowobj = document.getElementById("dis_"+data);  
    tbody.removeChild(rowobj);
 }
 function deleteDis(id){ 
 	if(confirm("确认要删除该疾病信息吗?")){
 			dataProhelper.delDis(id,callback4DisDelete);
 	} 
 }	    
var disid = "<%=disid%>";
function paraInfo(){  
    if("" == disid){
    	alert("请先保存疾病信息！");
        return;
    }
    window.parent.other.frameElement.src = "<%=basePath%>produce/disparadata.do?disid="+disid;
}
function symInfo(){
	 if("" == disid){
    	alert("请先保存疾病信息！");
        return;
    }
    window.parent.other.frameElement.src = "<%=basePath%>produce/dissymdata.do?disid="+disid;
}
function pointInfo(){
	 if("" == disid){
    	alert("请先保存疾病信息！");
        return;
    }
    window.parent.other.frameElement.src = "<%=basePath%>produce/dispointdata.do?disid="+disid;

}
function oldbookInfo(){ 
    window.parent.other.frameElement.src = "<%=basePath%>produce/oldbookdata.do?id=<%=id%>";

}

/**疾病信息保存结束**/	           
</script>
</head>
<body>
 
<div class="deta_proce_tab"> 
	<ul>
        <li><a href="javascript:paraInfo()">并发症<span id="para"></span></a></li>  
        <li><a href="javascript:symInfo()">证候<span id="sym"></span></a></li> 
        <li><a href="javascript:pointInfo()">穴位组<span id="pgroup"></span></a></li> 
        <li><a href="javascript:oldbookInfo()">古书籍引用<span id="oldbook"></span></a></li>  
    </ul> 
</div>
</body>
</html>

